package com.mxpio.erp.common.equipment.entity;

import com.mxpio.erp.common.equipment.vo.EquipmentStockRkApplyItemDTO;
import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * @Description: 入库单明细
 * @Author: jeecg-boot
 * @Date:   2021-10-07
 * @Version: V1.0
 */
@SqlResultSetMapping(
		name = "StockRkApplyItemDTOMapping",
		classes = @ConstructorResult(
				targetClass = EquipmentStockRkApplyItemDTO.class,
				columns = {
						@ColumnResult(name = "id", type = String.class),
						@ColumnResult(name = "applyId", type = String.class),
						@ColumnResult(name = "batchNo", type = String.class),
						@ColumnResult(name = "materialsId", type = String.class),
						@ColumnResult(name = "realPrice", type = BigDecimal.class),
						@ColumnResult(name = "quantity", type = Integer.class),
						@ColumnResult(name = "amount", type = BigDecimal.class),
						@ColumnResult(name = "rkTypeId", type = String.class),
						@ColumnResult(name = "status", type = Integer.class),
						@ColumnResult(name = "vendorId", type = String.class),
						@ColumnResult(name = "remark", type = String.class),
						@ColumnResult(name = "version", type = Integer.class),
						@ColumnResult(name = "materialsName", type = String.class),
						@ColumnResult(name = "materialsCode", type = String.class),
						@ColumnResult(name = "materialsType", type = String.class),
						@ColumnResult(name = "materialsBrand", type = String.class),
						@ColumnResult(name = "materialsSpec", type = String.class),
						@ColumnResult(name = "materialsUnit", type = String.class),
						@ColumnResult(name = "materialsEsPrice", type = BigDecimal.class),
						@ColumnResult(name = "receivedNum", type = Integer.class),
				}
		)
)
@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_EQUIPMENT_STOCK_RK_APPLY_ITEM")
@Schema(description="入库申请明细")
public class EquipmentStockRkApplyItem extends BaseEntity {
    private static final long serialVersionUID = 1L;

	/**id*/
    @Id
    @Generator
    @Column(name = "ID_", updatable = false)
    @Schema(description = "ID")
	private String id;
	/**删除标志*/
    @Column(name = "IS_DEL_")
    @Schema(description = "删除标志")
	private Integer isDel;
	/**版本*/
    @Column(name = "VERSION_")
    @Schema(description = "版本")
	private Integer version;
	/**金额*/
    @Column(name = "AMOUNT_")
    @Schema(description = "金额")
	private BigDecimal amount;
	/**批次号*/
    @Column(name = "BATCH_NO_")
    @Schema(description = "批次号")
	private String batchNo;
	/**入库数量*/
    @Column(name = "QUANTITY_")
    @Schema(description = "入库数量")
	private Integer quantity;
	/**实际价值*/
    @Column(name = "REAL_PRICE_")
    @Schema(description = "实际价值")
	private BigDecimal realPrice;
	/**备注*/
    @Column(name = "REMARK_")
    @Schema(description = "备注")
	private String remark;
	/**状态*/
	@Dict(dicCode = "ERP_EQUIPMENT_RK_STATUS")
    @Column(name = "STATUS_")
    @Schema(description = "状态")
	private Integer status;
	/**入库类型*/
	// todo entity缺失
//    @Dict(dicCode = "id",dicText = "inout_type_name",dicEntity = EquipmentStockTypeInout.class)
    @Column(name = "RK_TYPE_ID_")
    @Schema(description = "入库类型")
	private String rkTypeId;
	/**备品*/
    @Dict(dicCode = "id",dicText = "name",dicEntity = EquipmentMaterial.class)
    @Column(name = "MATERIALS_ID_")
    @Schema(description = "备品")
	private String materialsId;
	/**供应商*/
    @Dict(dicCode = "id",dicText = "name",dicEntity = EquipmentMerchants.class)
    @Column(name = "VENDOR_ID_")
    @Schema(description = "供应商")
	private String vendorId;
	/**入库单ID*/
    @Column(name = "APPLY_ID_")
    @Schema(description = "入库单ID")
	private String applyId;
	/**物料状态*/
    @Dict(dicCode = "ERP_EQUIPMENT_MATERIALS_STATUS")
    @Column(name = "MATERIALS_STATUS_")
    @Schema(description = "物料状态")
	private String materialsStatus;

	/**备品*/
	@Transient
	private String materialsName;
	@Transient
	private String materialsCode;
	@Transient
	private String materialsType;
	@Transient
	private String materialsBrand;
	@Transient
	private String materialsSpec;
	@Transient
	private String materialsUnit;
	@Transient
	private BigDecimal materialsEsPrice;
	@Transient
	private Integer receivedNum;
	@Transient
	private Integer thisOptNum;
	@Transient
	private String stocklocation;

}
